<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>发布房源-业主个人委托出租房屋</title>
    <link rel="stylesheet" href="${path}/plugins/bootstrap-3.3.7-dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="${path}/css/home2.css">
    <link href="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/css/datetimepicker.css" rel="stylesheet">

</head>
<body>
<script src="${path}/plugins/jquery-3.4.1.js"></script>
<script src="${path}/plugins/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
<script src="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<link rel="stylesheet" href="${path}/css/nav.css">

<link rel="stylesheet" href="${path}/plugins/layui/css/layui.css">

<style type="text/css">
    .imgDiv {
        display: inline-block;
        position: relative;
        border: 1px solid #C1C1C1;
        margin: 5px;
    }
    .imgDiv .delete {
        position: absolute;
        top: 0px;
        right: 0px;
        display: none;
    }
</style>


<%@ include file="../nav/headnav.jsp" %>

<div class="container-fluid" style="height: 850px;">
    <div class="row">
        <h1 style="text-align: center">免费发布出租房源</h1>
        <h4 style="color: red;text-align: center">绑定经纪人后发布才有效</h4>
        <br>
        <br>
        <br>
        <br>
        <form role="form">
            <input type="hidden" name="agentId" id="agentId" value="${agent_id}">
            <input type="hidden" name="landlordId" id="landlordId" value="${sessionScope.landlord.id}">
            <input type="hidden" name="state" id="state" value="待发布">
            <input type="hidden" name="rent" id="rent" value="合租">

            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">
                <div class="col-sm-6 col-md-2 col-md-offset-3" style="height: 34px;">
                    <span style="font-weight: 900;font-size: 18px;line-height: 34px">
                        <span class="red">*</span>
                        小区名称
                    </span>
                </div>
                <div class="col-sm-6 col-md-6" style="height: 34px">
                    <input type="text" id="name" class="col-md-6" style="line-height: 28px" placeholder="例:汤臣一品"/>
                </div>
            </div>
            <br>
            <br>
            <br>
            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">
                <div class="col-sm-6 col-md-2 col-md-offset-3" style="height: 34px;">
                    <span style="font-weight: 900;font-size: 18px;line-height: 34px">
                        <span class="red">*</span>
                        所在地域
                    </span>
                </div>
                <div class="col-sm-12 col-md-6" style="height: 34px">
                    <div style="float: left;width: 30%;">
                        <select name="input_area" id="input_city" class="form-control">
                            <option value="">姑苏区</option>
                            <option value="">虎丘区</option>
                            <option value="">吴中区</option>
                            <option value="">相城区</option>
                            <option value="">吴江区</option>
                            <option value="">常熟市</option>
                            <option value="">昆山市</option>
                            <option value="">太仓市</option>
                            <option value="">工业园区</option>
                            <option value="">张家港市</option>
                        </select>
                    </div>
                </div>
            </div>
            <br>
            <br>
            <br>
            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">
                <div class="col-sm-6 col-md-2 col-md-offset-3" style="height: 34px;">
                    <span style="font-weight: 900;font-size: 18px;line-height: 34px">
                        <span class="red">*</span>
                        户&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;型
                    </span>
                </div>
                <div class="col-sm-12 col-md-6" style="height: 34px">
                    <div style="float: left;width: 30%;">
                        <select name="input_area" id="select_type" class="form-control">
                            <option value="">小户型</option>
                            <option value="">中户型</option>
                            <option value="">大户型</option>
                        </select>
                    </div>
                </div>
            </div>
            <br>
            <br>
            <br>
            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">
                <div class="col-sm-6 col-md-2 col-md-offset-3" style="height: 34px;">
                    <span style="font-weight: 900;font-size: 18px;line-height: 34px">
                        <span class="red">*</span>
                        建筑面积
                    </span>
                </div>
                <div class="col-sm-12 col-md-6" style="height: 34px">
                    <div style="float: left;width: 30%;">
                        <select name="input_area" id="inputArea" class="form-control">
                            <option value="">小于等于89平方米</option>
                            <option value="">大于89平方米</option>
                        </select>
                    </div>
                </div>
            </div>
            <br>
            <br>
            <br>
            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">
                <div class="col-sm-6 col-md-2 col-md-offset-3" style="height: 34px;">
                    <span style="font-weight: 900;font-size: 18px;line-height: 34px">
                        <span class="red">*</span>
                        朝&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;向
                    </span>
                </div>
                <div class="col-sm-12 col-md-6" style="height: 34px">
                    <div style="float: left;width: 30%;">
                        <select name="input_area" id="input_direction" class="form-control">
                            <option value="">南北</option>
                            <option value="">南</option>
                            <option value="">东南</option>
                            <option value="">东</option>
                            <option value="">西南</option>
                            <option value="">北</option>
                            <option value="">西</option>
                            <option value="">东西</option>
                            <option value="">东北</option>
                            <option value="">西北</option>
                        </select>
                    </div>
                </div>
            </div>
            <br>
            <br>
            <br>
            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">
                <div class="col-sm-6 col-md-2 col-md-offset-3" style="height: 34px;">
                    <span style="font-weight: 900;font-size: 18px;line-height: 34px">
                        <span class="red">*</span>
                        楼&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;层
                    </span>
                </div>
                <div class="col-sm-6 col-md-3" style="height: 34px">
                    <input type="text" class="col-md-3" style="line-height: 28px" name="floor" id="floor"
                           placeholder="例:15"/><span style="float: left;line-height: 34px;font-size: medium">层</span>
                </div>
            </div>
            <br>
            <br>
            <br>
            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">
                <div class="col-sm-6 col-md-2 col-md-offset-3" style="height: 34px;">
                    <span style="font-weight: 900;font-size: 18px;line-height: 34px">
                        <span class="red">*</span>
                        门&nbsp;&nbsp;牌&nbsp;&nbsp;号
                    </span>
                </div>
                <div class="col-sm-6 col-md-6" style="height: 34px">
                    <input type="text" id="number1" class="col-md-3" style="line-height: 28px" placeholder="例:8"/><span
                        style="float: left;line-height: 34px;font-size: medium">幢</span>
                    <input type="text" id="number2" class="col-md-3" style="line-height: 28px"
                           placeholder="例:520"/><span style="float: left;line-height: 34px;font-size: medium">室</span>
                </div>
            </div>
            <br>
            <br>
            <br>
            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">
                <div class="col-sm-6 col-md-2 col-md-offset-3" style="height: 34px;">
                    <span style="font-weight: 900;font-size: 18px;line-height: 34px">
                        <span class="red">*</span>
                        租&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;金
                    </span>
                </div>
                <div class="col-sm-6 col-md-6" style="height: 34px">
                    <input type="text" id="rent_money" class="col-md-3" style="line-height: 28px"/><span
                        style="float: left;line-height: 34px;font-size: medium">元/月</span>
                </div>
            </div>
            <br>
            <br>
            <br>
            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">
                <div class="col-sm-6 col-md-2 col-md-offset-3" style="height: 34px;">
                    <span style="font-weight: 900;font-size: 18px;line-height: 34px">
                        <span class="red">*</span>
                        车&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;位
                    </span>
                </div>
                <div class="col-sm-9 col-md-7" style="height: 34px">
                    <label class="radio-inline" style="float: left;line-height: 34px;font-size: medium"><input
                            type="radio" name="car" id="car1" style="margin-top: 11px" checked>是</label>
                    <label class="radio-inline" style="float: left;line-height: 34px;font-size: medium"><input
                            type="radio" name="car" id="car2" style="margin-top: 11px">否</label>
                </div>
            </div>

            <br>
            <br>
            <br>
            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">
                <div class="col-sm-6 col-md-2 col-md-offset-3" style="height: 34px;">
                    <span style="font-weight: 900;font-size: 18px;line-height: 34px">
                        <span class="red">*</span>
                        房屋亮点
                    </span>
                </div>
                <div class="col-sm-6 col-md-6" style="height: 34px">
                    <div class="form-group">
                        <textarea class="form-control" rows="1" placeholder="可输入房屋亮点，卖点" name="evaluate"
                                  id="evaluate"></textarea>
                    </div>
                </div>
            </div>

            <br>
            <br>
            <br>
            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">
                <div class="col-sm-6 col-md-2 col-md-offset-3" style="height: 34px;">
                    <span style="font-weight: 900;font-size: 18px;line-height: 34px">
                        <span class="red">*</span>
                        房主要求
                    </span>
                </div>
                <div class="col-sm-6 col-md-6" style="height: 34px">
                    <div class="form-group">
                        <textarea class="form-control" rows="1" placeholder="可输入房间描述,对合租者的要求等信息" name="require"
                                  id="require"></textarea>
                    </div>
                </div>
            </div>

            <br>
            <br>
            <br>
            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">
                <div class="col-sm-6 col-md-2 col-md-offset-3" style="height: 34px;">
                    <span style="font-weight: 900;font-size: 18px;line-height: 34px">
                        <span class="red">*</span>
                        合租要求
                    </span>
                </div>
                <div class="col-sm-6 col-md-6" style="height: 34px">

                    <div style="float: left">
                        <label class="checkbox-inline">
                            <input type="checkbox" id="box1" value="op1">要求租户稳定
                        </label>
                        <label class="checkbox-inline">
                            <input type="checkbox" id="box2" value="op2">是否单身
                        </label>
                        <label class="checkbox-inline">
                            <input type="checkbox" id="box3" value="op3">性别（选中要求男否则要求女）
                        </label>
                    </div>
                    <div style="float: left;">
                        <label class="checkbox-inline">
                            <input type="checkbox" id="box4" value="op4">要求作息正常
                        </label>
                        <label class="checkbox-inline">
                            <input type="checkbox" id="box5" value="op5">是否允许吸烟
                        </label>
                        <label class="checkbox-inline">
                            <input type="checkbox" id="box6" value="op6">是否允许养宠物
                        </label>
                    </div>

                </div>
            </div>

            <br>
            <br>
            <br>
            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">
                <div class="col-sm-6 col-md-2 col-md-offset-3" style="height: 100px;">
                    <span style="font-weight: 900;font-size: 18px;line-height: 100px">
                        <span class="red">*</span>
                        环境设施
                    </span>
                </div>
                <div class="col-sm-6 col-md-6" style="height: 100px">
                    <div style="float: left">
                        <label class="checkbox-inline">
                            <input type="checkbox" id="h1" value="op1">冰箱
                        </label>
                        <label class="checkbox-inline">
                            <input type="checkbox" id="h2" value="op2">电视
                        </label>
                        <label class="checkbox-inline">
                            <input type="checkbox" id="h3" value="op3">空调
                        </label>
                        <label class="checkbox-inline">
                            <input type="checkbox" id="h4" value="op4">热水器
                        </label>
                        <label class="checkbox-inline">
                            <input type="checkbox" id="h5" value="op5">洗衣机
                        </label>
                    </div>
                    <div style="float: left">
                        <label class="checkbox-inline">
                            <input type="checkbox" id="h6" value="op6">宽带
                        </label>
                        <label class="checkbox-inline">
                            <input type="checkbox" id="h7" value="op7">沙发
                        </label>
                        <label class="checkbox-inline">
                            <input type="checkbox" id="h8" value="op8">阳台
                        </label>
                        <label class="checkbox-inline">
                            <input type="checkbox" id="h9" value="op9">燃气灶
                        </label>
                        <label class="checkbox-inline">
                            <input type="checkbox" id="h10" value="op10">油烟机
                        </label>
                    </div>
                    <div style="float: left">
                        <label class="checkbox-inline">
                            <input type="checkbox" id="h11" value="op11">衣柜
                        </label>
                        <label class="checkbox-inline">
                            <input type="checkbox" id="h12" value="op12">暖气
                        </label>
                        <label class="checkbox-inline">
                            <input type="checkbox" id="h13" value="op13">床&nbsp;&nbsp;&nbsp;&nbsp;
                        </label>
                        <label class="checkbox-inline">
                            <input type="checkbox" id="h14" value="op14"> 智能门锁
                        </label>
                    </div>
                    <div style="float: left">
                        <label class="checkbox-inline">
                            <input type="checkbox" id="h15" value="opa">绿化多
                        </label>
                        <label class="checkbox-inline">
                            <input type="checkbox" id="h16" value="opb">学区房
                        </label>
                        <label class="checkbox-inline">
                            <input type="checkbox" id="h17" value="opc">可做饭
                        </label>
                        <label class="checkbox-inline">
                            <input type="checkbox" id="h18" value="opd">独立卫生间
                        </label>
                    </div>
                    <div style="float: left">
                        <label class="checkbox-inline">
                            <input type="checkbox" id="h19" value="ope">交通便利
                        </label>
                        <label class="checkbox-inline">
                            <input type="checkbox" id="h20" value="opf">购物方便
                        </label>
                    </div>
                </div>
            </div>


            <br>
            <br>
            <br>
            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">
                <div class="col-sm-6 col-md-2 col-md-offset-3" style="height: 430px;">
                    <span style="font-weight: 900;font-size: 18px;line-height: 34px">
                        <span class="red">*</span>
                        房产证明
                    </span>
                </div>
                <div class="col-sm-6 col-md-6" style="height: 430px">
                    <div class="layui-progress" style="margin-top:10px;width: 450px" lay-filter="demo">
                        <div class="layui-progress-bar" style="float: left" lay-percent="0%"><span id="bar">0%</span></div>
                    </div>

                    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
                        <legend>拖拽或点击上传</legend>
                    </fieldset>

                    <div class="layui-upload-drag" id="picture" style="float: left">
                        <i class="layui-icon"></i>
                        <p>点击上传，或将文件拖拽到此处</p>
                        <div class="layui-hide" id="uploadDemoView">
                            <hr>
                            <img src="" alt="上传成功后渲染" style="max-width: 196px">
                        </div>
                    </div>
                </div>
            </div>
            <br>
            <br>
            <br>
            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">
                <div class="col-sm-6 col-md-2 col-md-offset-3" style="height: 430px;">
                    <span style="font-weight: 900;font-size: 18px;line-height: 34px">
                        <span class="red">*</span>
                        房源主图
                    </span>
                </div>
                <div class="col-sm-6 col-md-6" style="height: 430px">
                    <div class="layui-progress" style="margin-top:10px;width: 450px" lay-filter="demo2">
                        <div class="layui-progress-bar" style="float: left" lay-percent="0%"><span id="bar2">0%</span></div>
                    </div>

                    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
                        <legend>拖拽或点击上传</legend>
                    </fieldset>

                    <div class="layui-upload-drag" id="imgUrl" style="float: left">
                        <i class="layui-icon"></i>
                        <p>点击上传，或将文件拖拽到此处</p>
                        <div class="layui-hide" id="uploadDemoView2">
                            <hr>
                            <img src="" alt="上传成功后渲染" style="max-width: 196px">
                        </div>
                    </div>
                </div>
            </div>

            <br>
            <br>
            <br>
            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">
                <div class="col-sm-6 col-md-2 col-md-offset-3" style="height: 430px;">
                    <span style="font-weight: 900;font-size: 18px;line-height: 34px">
                        <span class="red">*</span>
                        房源套图
                    </span>
                </div>
                <div class="col-sm-6 col-md-6" style="height: 430px">

                    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
                        <legend>最多上传6张</legend>
                    </fieldset>

                    <div class="layui-upload">
                        <button type="button" class="layui-btn" id="test2">多图片上传</button>
                        <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">
                            预览图：
                            <div class="layui-upload-list" id="demo2"></div>
                        </blockquote>
                    </div>
                </div>
            </div>

            <br>
            <br>
            <br>
            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">
                <div class="col-sm-6 col-md-2 col-md-offset-3" style="height: 34px;">
                    <span style="font-weight: 900;font-size: 18px;line-height: 34px">
                        <span class="red">*</span>
                        租&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;期
                    </span>
                </div>
                <div class="col-sm-12 col-md-6" style="height: 34px">
                    <div style="float: left;width: 30%;">
                        <select name="input_area" id="tendency" class="form-control">
                            <option value="">一个月起租</option>
                            <option value="">三个月起租</option>
                            <option value="">半年起租</option>
                            <option value="">一年起租</option>
                            <option value="">二年起租</option>
                        </select>
                    </div>
                </div>
            </div>

            <br>
            <br>
            <br>
            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">
                <input type="checkbox" name="ck_content"/>
                <span>我已阅读并同意</span>
                <span>
                        <a href="#" target="_blank">《淘房服务协议》</a>
                        <a href="#" target="_blank">《隐私权政策》</a>
                </span>
            </div>
            <br>
            <br>
            <br>
            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">
                <button type="button" onclick="x()" class="btn btn-primary btn-lg">确认发布</button>
            </div>
        </form>
    </div>
</div>


<!--底部导航栏-->
<%@ include file="../nav/footnav.jsp" %>
<!--底部导航栏end-->

<script src="${path}/plugins/jquery-3.4.1.js"></script>
<script src="${path}/plugins/layui/layui.js"></script>

<script>

    layui.use(['upload', 'element'], function () {
        let upload = layui.upload;//初始化
        let element = layui.element;//初始化进度条
        //拖拽上传
        upload.render({
            elem: '#picture'
            , url: '${path}/post/layui/upload/nginx' //改成您自己的上传接口
            , done: function (res) {
                layer.msg('图片上传成功', {icon: 6});
                layui.$('#uploadDemoView').removeClass('layui-hide').find('img').attr('src', "http://${path2}/img/" + res.data);
                console.log(res);
            },
            progress: function (n, elem) {
                var percent = n + '%' //获取进度百分比
                element.progress('demo', percent); //可配合 layui 进度条元素使用
                document.getElementById("bar").innerText = n+"%";
                console.log(elem); //得到当前触发的元素 DOM 对象。可通过该元素定义的属性值匹配到对应的进度条。
            }
        });
    })

    layui.use(['upload', 'element'], function () {
        let upload = layui.upload;//初始化
        let element = layui.element;//初始化进度条
        //拖拽上传
        upload.render({
            elem: '#imgUrl'
            , url: '${path}/post/layui/upload/nginx2' //改成您自己的上传接口
            , done: function (res) {
                layer.msg('图片上传成功!', {icon: 6});
                layui.$('#uploadDemoView2').removeClass('layui-hide').find('img').attr('src', "http://${path2}/img/" + res.data);
                console.log(res);
            },
            progress: function (n, elem) {
                var percent = n + '%' //获取进度百分比
                element.progress('demo2', percent); //可配合 layui 进度条元素使用
                document.getElementById("bar2").innerText = n+"%";
                console.log(elem); //得到当前触发的元素 DOM 对象。可通过该元素定义的属性值匹配到对应的进度条。
            }
        });
    })

    //多图片上传
    layui.use(['upload', 'element'], function () {
        let upload = layui.upload;//初始化
        let element = layui.element;//初始化进度条
        var count = 0;
        upload.render({
            elem: '#test2'
            , url: '${path}/post/layui/upload/nginx3' //改成您自己的上传接口
            , accept: 'images'
            , acceptMime: 'image/jpg,image/png,image/jpeg'
            , exts: 'jpg|png|jpeg'
            , multiple: true
            , before: function (obj) {
                //预读本地文件示例，不支持ie8
                obj.preview(function (index, file, result) {
                    $('#demo2').append('<img src="' + result + '" alt="' + file.name + '" class="layui-upload-img" style="width: 70px;height: 70px">')
                    count++;
                    if (count>=6){
                        $('#test2').addClass("layui-btn-disabled").attr("disabled",true);
                    }
                });
            }
            , done: function (res) {
                //上传完毕
                layer.msg('图片上传成功!', {icon:6});

                console.log(res);
            }
        });
    })

    $(function () {
        $(".form_date").datetimepicker({
            format: 'yyyy-mm-dd',
            todayBtn: true,
            maxView: 'year',
            minView: 'month'
        });
    });

    function x() {

        let name = $("#name").val()

        let number1 = $("#number1").val()
        let number2 = $("#number2").val()
        let number3 = number1 + "-" + number2

        let city = $("#input_city option:selected").text();
        // alert(city)

        let type = $("#select_type option:selected").text();
        //alert(type)

        let area = $("#inputArea option:selected").text();
        //alert(area)

        let direction = $("#input_direction option:selected").text();
        //alert(direction)

        let floor = $("#floor").val()
        //alert(floor)

        let car1 = document.getElementById("car1").checked;
        let car2 = document.getElementById("car2").checked;
        let car = ""
        if (car1) {
            car = "true"
        } else if (car2) {
            car = "false"
        }
        // alert(car)

        let require = $("#require").val()
        //alert(require)

        let picture = $("#picture").val()
        //alert(picture)

        let date = $("#tendency option:selected").text();
        //alert(date)

        let agentId = $("#agentId").val()

        let landlordId = $("#landlordId").val()

        let evaluate = $("#evaluate").val()

        let state = $("#state").val()

        let money = $("#rent_money").val()

        let rent = $("#rent").val()

        let box1 = document.getElementById("box1").checked;//租户是否稳定
        let box2 = document.getElementById("box2").checked;//是否单身
        let box3 = document.getElementById("box3").checked;//性别
        let box4 = document.getElementById("box4").checked;//作息是否正常
        let box5 = document.getElementById("box5").checked;//是否吸烟
        let box6 = document.getElementById("box6").checked;//是否允许养宠物


        let h1 = document.getElementById("h1").checked;
        let h2 = document.getElementById("h2").checked;
        let h3 = document.getElementById("h3").checked;
        let h4 = document.getElementById("h4").checked;
        let h5 = document.getElementById("h5").checked;
        let h6 = document.getElementById("h6").checked;
        let h7 = document.getElementById("h7").checked;
        let h8 = document.getElementById("h8").checked;
        let h9 = document.getElementById("h9").checked;
        let h10 = document.getElementById("h10").checked;
        let h11 = document.getElementById("h11").checked;
        let h12 = document.getElementById("h12").checked;
        let h13 = document.getElementById("h13").checked;
        let h14 = document.getElementById("h14").checked;
        let h15 = document.getElementById("h15").checked;
        let h16 = document.getElementById("h16").checked;
        let h17 = document.getElementById("h17").checked;
        let h18 = document.getElementById("h18").checked;
        let h19 = document.getElementById("h19").checked;
        let h20 = document.getElementById("h20").checked;

        let cks = document.getElementsByName("ck_content");
        let count = 0;

        for (let i = 0; i < cks.length; i++) {
            if (cks[i].checked) {
                count++;
            }
        }
        if (count === 0) {
            alert("请确认协议")

        } else {

            let datas = {"number":number3,"name": name}
            $.post('/taofang/post/checkHouseId/'+number3+'/'+name, datas, function (data) {
                if (data.code == 200) {

                    window.location = "/taofang/post/addHouse2?" +
                        "agentId=" + agentId + "&landlordId=" + landlordId + "&evaluate" +
                        "=" + evaluate + "&require=" + require + "&picture=" + picture + "&type" +
                        "=" + type + "&area=" + area + "&floor=" + floor + "&car=" + car + "&date" +
                        "=" + date + "&direction=" + direction + "&city=" + city + "&rent" +
                        "=" + rent + "&state=" + state + "&money=" + money + "&name=" + name + "&number=" + number3 + "&box1" +
                        "=" + box1 + "&box2=" + box2 + "&box3=" + box3 + "&box4" +
                        "=" + box4 + "&box5=" + box5 + "&box6=" + box6 + "&house_id=" + '${house_id}' + "&h1=" + h1 + "&h2=" + h2 + "&h3" +
                        "=" + h3 + "&h4=" + h4 + "&h5=" + h5 + "&h6=" + h6 + "&h7=" + h7 + "&h8=" + h8 + "&h9=" + h9 + "&h10" +
                        "=" + h10 + "&h11=" + h11 + "&h12=" + h12 + "&h13=" + h13 + "&h14=" + h14 + "&h15=" + h15 + "&h16" +
                        "=" + h16 + "&h17=" + h17 + "&h18=" + h18 + "&h19=" + h19 + "&h20=" + h20;

                } else {
                    alert("该房源已发布，请更改小区名或门牌号！")
                }
            })

        }

    }


    // function checked() {
    //     let cks = document.getElementsByName("ck_content");
    //     let count = 0;
    //     let flag = true;
    //     for (let i = 0; i < cks.length; i++) {
    //         if (cks[i].checked){
    //             count++;
    //         }
    //     }
    //     if (count==0){
    //         alert("请确认协议")
    //         flag = false;
    //     }
    //     return flag;
    // }

</script>


</body>
</html>